package com.wyw.function.learning.demo9;

import com.wyw.function.learning.common.MergeInfoService2;

import java.util.function.Supplier;

/**
 * @Title   实践案例测试
 * @Description
 * @Author Mr Wu yewen.wu.china@gmail.com
 * Update History:
 * Author        Time            Content
 */
public class DemoClient27 {

    public static void main(String[] args) {
//        MergeInfoService mergeInfoService = new MergeInfoService();
//        log(() -> mergeInfoService.getInfo("Mx00110"));

        MergeInfoService2 service2 = new MergeInfoService2();
        log(() -> service2.getInfo("MX00111"));
    }

    private static <T> T log(Supplier<T> supplier) {
        long start = System.currentTimeMillis();
        T t = supplier.get();
        System.out.println(System.currentTimeMillis() - start + ":ms");
        return t;
    }
}

